home *** CD-ROM | disk | FTP | other *** search
- /*
- IC Specific Override.c
-
- This is a C port of the ICSpecificOverride.p file.
-
- History:
- 11/17/95 dhn - Started port.
- */
-
- /*
- Original comment:
-
- Internet Config Specific Overide Component
-
- Routine names have an ICSO prefix for Internet Config Specific Override.
-
- To create an IC override component you need to make a copy of this
- file and fill in the blanks. This is an N stage process:
-
- 1. Make a copy of this file.
- 2. Change kOurComponentManufacturer to your manufacturer code.
- 3. Add any shared globals to the sharedGlobals record.
- 4. If you have shared globals then init them in ICSOInitShared.
- 5. If the shared globals need cleaning up then clean them ICSOCleanShared.
- 6. Add any instance specific globals to globalsRecord.
- 7. If you have globals then init them in ICSOInitGlobals.
- 8. If the globals need cleaning up then clean them ICSOCleanGlobals.
- 9. If you want to add a completely new routine or remove support for one of the built in routines then modify
- ICSOCanDo accordingly.
- 10. Modify ICSOWhatToOverride to return the correct ProcPtr for each routine that you override or add.
- 11. Write each routine. If you want the component to continue calling through to the captured component for
- this routine then have your routine return delegateThisCallErr.
- 12. Smirk at the wonders of Component Manager.
- 13. Looking inside ICGenericOverride and frown at the wonders of Component Manager.
-
- Share and Enjoy.
-
- Quinn
- 12 Feb 1995
- */
-
- #include <Components.h>
-
- #include "IC Specific Override.h"
-
- #include "IC Component API.h"
- #include "IC Generic Override.h"
-
- #include "IC Component Selectors.h"
-
- pascal ComponentResult RSCGetPref(GlobalsHandle globals,StringPtr key,ICAttr* attr,Ptr buf,long* size);
- pascal ComponentResult RSCSetPref(GlobalsHandle globals,StringPtr key,ICAttr* attr,Ptr buf,long* size);
-
- enum {
- uppICSOReadOnlyProcInfo=kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
- | STACK_ROUTINE_PARAMETER(1,SIZE_CODE(sizeof(GlobalsHandle)))
- | STACK_ROUTINE_PARAMETER(2,SIZE_CODE(sizeof(StringPtr)))
- | STACK_ROUTINE_PARAMETER(3,SIZE_CODE(sizeof(ICAttr*)))
- | STACK_ROUTINE_PARAMETER(4,SIZE_CODE(sizeof(Ptr)))
- | STACK_ROUTINE_PARAMETER(5,SIZE_CODE(sizeof(long*)))
- };
-
- pascal ComponentResult ICSOInitShared(GlobalsHandle globals){
-
- return noErr;
- }
-
- pascal ComponentResult ICSOCleanShared(GlobalsHandle globals){
-
- return noErr;
- }
-
- pascal ComponentResult ICSOInitGlobals(GlobalsHandle globals){
-
- return noErr;
- }
-
- pascal ComponentResult ICSOCleanGlobals(GlobalsHandle globals){
-
- return noErr;
- }
-
- pascal ComponentResult ICSOCanDo(GlobalsHandle globals,short selector){
-
- return delegateThisCallErr;
- }
-
- pascal ComponentResult RSCGetPref(GlobalsHandle globals,StringPtr key,ICAttr* attr,Ptr buf,long* size){
- ICError err;
-
- err=ICCGetPref((*globals)->delegate,key,attr,buf,size);
- *attr|=ICattr_locked_bit;
-
- return err;
- }
-
- pascal ComponentResult RSCSetPref(GlobalsHandle globals,StringPtr key,ICAttr* attr,Ptr buf,long* size){
-
- return icPermErr;
- }
-
- pascal ComponentFunctionUPP ICSOWhatToOverride(GlobalsHandle globals,short selector){
- ComponentFunctionUPP proc=(ComponentFunctionUPP)0;
-
- if (selector==kICCGetPref)
- proc=BuildNewProc(RSCGetPref,uppICSOReadOnlyProcInfo);
- else if (selector==kICCSetPref)
- proc=BuildNewProc(RSCSetPref,uppICSOReadOnlyProcInfo);
-
- return proc;
- }
-